package com.holyant.report.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.domain.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Objects;

/**
 * 商品价格趋势dto
 * 
 * @author hxd
 * @date 2022-01-19
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("商品价格趋势")
public class RptGoodsPriceTrendDto extends BaseDto {

    private static final long serialVersionUID = 1L;

    /** 商品id */
    @ApiModelProperty(value = "商品id")
    private Long goodsId;
    /** 商品名 */
    @Excel(name = "商品名")
    @ApiModelProperty(value = "商品名")
    private String goodsName;
    /** 商品条码 */
    @Excel(name = "商品条码")
    @ApiModelProperty(value = "商品条码")
    private String goodsBarcode;
    /** 销售渠道 */
    @Excel(name = "销售渠道")
    @ApiModelProperty(value = "销售渠道")
    private Integer customerChannel;
    /** 所属分类id */
    @ApiModelProperty(value = "所属分类id")
    private Long categoryId;
    /** 所属分类名称 */
    @ApiModelProperty(value = "所属分类名称")
    private String categoryName;
    /** 所属分类编码 */
    @ApiModelProperty(value = "所属分类编码")
    private String categoryCode;
    /** 品牌id */
    @ApiModelProperty(value = "品牌id")
    private Long brandId;
    /** 品牌名称 */
    @Excel(name = "品牌名称")
    @ApiModelProperty(value = "品牌名称")
    private String brandName;
    /** 效期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "效期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "效期")
    private LocalDate expireDate;
    /** 备注 */
    @Excel(name = "备注")
    @ApiModelProperty(value = "备注")
    private String remark;
    /** 价格生成日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "价格生成日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "价格生成日期")
    private LocalDate priceDate;
    /** 当天价格 */
    @Excel(name = "当天价格")
    @ApiModelProperty(value = "当天价格")
    private BigDecimal price;
    /** 一般价格 */
    @Excel(name = "一般价格")
    @ApiModelProperty(value = "一般价格")
    private BigDecimal commonPrice;
    /** 正常价格 */
    @Excel(name = "正常价格")
    @ApiModelProperty(value = "正常价格")
    private BigDecimal normalPrice;
    /** 落地价格 */
    @Excel(name = "落地价格")
    @ApiModelProperty(value = "落地价格")
    private BigDecimal landPrice;
    /** 版本号 */
    @ApiModelProperty(value = "版本号")
    private Long ver;

    @JsonIgnore
    private String goodsKey;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RptGoodsPriceTrendDto that = (RptGoodsPriceTrendDto) o;
        return Objects.equals(goodsId, that.goodsId) &&
                Objects.equals(customerChannel, that.customerChannel) &&
                Objects.equals(expireDate, that.expireDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(goodsId, customerChannel, expireDate);
    }
}
